<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/9
 * Time: 15:47
 */
namespace Admin\Model;
use Base\Model\BaseModel;

class InspectioninfoModel extends BaseModel
{
    protected $_validate = array(
        array('name', 'require', '名称必须填写'),
//        array('name', '', '名称不能重复', 0, 'unique', 3),
         array('sort','/^[0-9]+$/', '排序只能输入整数型！',2),

    );
    protected $_link=array(
        'Inspectiontypeinfo' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name'    => 'Inspectiontypeinfo',
            'foreign_key' => 'typeid',
            'parent_key' => 'id',
            'mapping_fields' => 'id,name'
        ),
//        //化验单化验项外索引
//        'inspectiondetailinfo' => array(
//            'mapping_type' => self::HAS_MANY ,
//            'foreign_key' => 'medicalid',
//            'parent_key' => 'id',
//        ),
    );
    protected $_auto = array(
        array('status', '1'),
    );
}